# -*- coding: utf-8 -*-
# copyright 2009  Nik Lutz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kdeui import *
from PyKDE4.kio import *
from PyKDE4.kdecore import *
from ui_configparameters import Ui_Form

class ConfigParameters(QWidget, Ui_Form):
    plasmoid = None
    def __init__(self, parent, configuration ):
        QWidget.__init__(self)

        self.setupUi(self)
        self.plasmoid = parent
        
        self.servername.setText(configuration.name)
        self.nagios_url.setText(configuration.nagios_url)
        self.nagios_cgi_url.setText(configuration.nagios_cgi_url)
        self.username.setText(configuration.username)
        self.password.setText(configuration.password)

        self.pollinterval.setValue(parent.getPollInterval())
    
    def getNagiosUrl(self):
        return  self.nagios_url.text()
   
    def getNagiosCgiUrl(self):
        return  self.nagios_cgi_url.text()

    def getUsername(self):
        return  self.username.text()

    def getPassword(self):
        return  self.password.text()
    
    def getPollinterval(self):
        return  self.pollinterval.value()
    
    def getServerName(self):
        return  self.servername.text()




